<include file="header" />
<body>
<div class="wraper">
    <div class="top">
        <a href="{BEESCRM::U('base/ips/index',array('ips_id'=>$ips_id))}" class="iconfont icon-zuo pull-left"></a>
        <span class="pull-left">立即充值</span>
        <a href="{BEESCRM::U('base/ips/index',array('ips_id'=>$ips_id))}" class="iconfont icon-shouye pull-right text-right"></a>
    </div>
    <div class="contain-box charge-status margin-top">
        <span class="iconfont icon-biaoqing"></span>充值成功！页面跳转中……
    </div>
    <div class="info-box margin-top">
        <p>充值金额：<span class="price">{BEESCRM:$data.order_amount}</span></p>
        <p>园区：{BEESCRM:$community_name}</p>
        <p>楼幢：{BEESCRM:$building_name}</p>
        <p>楼层：{BEESCRM:$floor_name}</p>
        <p>寝室号：{BEESCRM:$room_name}</p>
    </div>
</div>
<include file="commonJS" />
<script type="text/javascript">

    $(function(){
            var room_id = {BEESCRM:$room_id};
            $.ajax({
                url:"/base/ips/on/ips_id/{BEESCRM:$ips_id}",
                type:"post",
                data:{room_id:room_id},
                dataType:"json",
                success:function(res){
                    if(res.status == 'S'){
                        fm.alert('充值成功，3秒后跳转');
                        var url = '{BEESCRM:$toUrl}';
                        if(url){
                            setTimeout("location.href = '{BEESCRM:$toUrl}'",3000);
                        }
                    }else{
                        fm.alert(res.message);
                        var url = '{BEESCRM:$toUrl}';
                        if(url){
                            setTimeout("location.href = '{BEESCRM:$toUrl}'",1000);
                        }
                    }
                },
                error:function(XMLHttpRequest, textStatus, errorThrown){
                    alert(XMLHttpRequest.status);
                    alert(XMLHttpRequest.readyState);
                     alert(textStatus);
                }
            })
    });


//	$(document).ready(function(){
//		var url = '{BEESCRM:$toUrl}';
//		if(url){
//			setTimeout("location.href = '{BEESCRM:$toUrl}'",3000);
//		}
//	});
</script>

</body>
</html>